from django import forms
from .models import PlatePost, PlateComment, PostColumn


# 写文章的表单类
class PlatePostForm(forms.ModelForm):
    class Meta:
        # 指明数据模型来源
        model = PlatePost
        # 定义表单包含的字段
        fields = ('title', 'category', 'column', 'content', 'tags')


class CommentForm(forms.ModelForm):
    class Meta:
        model = PlateComment
        fields = ['content']


class PostColumnAdminForm(forms.ModelForm):
    class Meta:
        model = PostColumn
        fields = ['title']

